home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
FifoFacility.h,v
< prev
next >
Wrap
Text File
|
1989-06-25
|
1KB
|
85 lines
head 1.1;
branch ;
access ;
symbols ;
locks grunwald:1.1; strict;
comment @ * @;
1.1
date 88.09.18.16.42.04; author grunwald; state Exp;
branches ;
next ;
desc
@@
1.1
log
@Initial revision
@
text
@#ifndef FIFO_FACILITYH
#define FIFO_FACILITYH
#include "FifoSemaphore.h"
#include "TimeContainer.h"
class Thread;
//
// This is why you need multiple inheritence.
//
class FifoFacility : public FifoSemaphore {
protected:
short servers;
struct {
double single; // valid when servers == 1
double *many; // valid when servers > 1
} whenServiced;
double serviceStarted;
double totalServiceTime;
int pTotalReserves;
TimeContainer *time; // our measure of time
virtual void reportErrorState(ostream&);
void commonReserve();
public :
FifoFacility(int servers = 1,
TimeContainer *time = 0,
bool debug = FALSE);
~FifoFacility();
virtual void reserve();
virtual void release();
virtual bool reserveNoBlock();
virtual void use(double);
virtual void reset();
virtual double utilization();
virtual int totalReserves();
virtual bool isEmpty();
virtual unsigned queueLength();
virtual unsigned activeServers();
virtual unsigned size();
virtual void classPrintOn(ostream& s);
};
#endif FIFO_FACILITYH
@